import { ipcMain, remote, app } from "electron";
const fs = require("fs");
const filsInit = () => {
  ipcMain.on("save-start", (e, arg) => {
    console.log("99f发都发");
    // const configDir = remote.app.getPath("userData");
    e.sender.send("save-success", "filePath");
    // const { msg, targetPath } = arg;
    // fs.writeFile(targetPath, msg, err => {
    //   if (err) {
    //     e.sender.send("save-success", err);
    //     return;
    //   }
    // e.sender.send("save-success", "成功");
    // });
  });
};

export { filsInit };
/*
app 从electron导出
app.getPath("downloads")  获取当前电脑的下载文件目录
remote.dialog.showOpenDialog().then(result => {  //打开弹出框选择文件
        console.log(result.filePaths)
      })
*/
